<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\IndexController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::post('/redpacket', [IndexController::class, 'setRedPacket']);

Route::get('/redpacket', [IndexController::class, 'robRedPacket']);

Route::prefix('redis')
    ->group(function () {
        Route::get('string', [\App\Http\Controllers\Api\RedisController::class, 'string']);
        Route::get('list', [\App\Http\Controllers\Api\RedisController::class, 'list']);
        Route::get('hash', [\App\Http\Controllers\Api\RedisController::class, 'hash']);
        Route::get('set', [\App\Http\Controllers\Api\RedisController::class, 'set']);
        Route::get('zset', [\App\Http\Controllers\Api\RedisController::class, 'zset']);
        Route::get('publish', [\App\Http\Controllers\Api\RedisController::class, 'publish']);
    });

Route::prefix('user')
    ->group(function () {
        Route::get('', [\App\Http\Controllers\Api\UserController::class, 'index']);
        Route::post('', [\App\Http\Controllers\Api\UserController::class, 'create']);
    });



